package cn.tedu.spring.dilistmap;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestTeacher {
    @Test
    public void apple() {
        ApplicationContext context = new ClassPathXmlApplicationContext
                ("bean-listmap.xml");
        Teacher teacher = context.getBean("teacher", Teacher.class);
        System.out.println(teacher);
    }

    @Test
    public void stuMap() {
        ApplicationContext context = new ClassPathXmlApplicationContext
                ("bean-dimap.xml");
        Student student = context.getBean("stuMap", Student.class);
        System.out.println(student);
    }

    @Test
    public void TestLM() {
        ApplicationContext context = new ClassPathXmlApplicationContext
                ("bean-diref.xml");
        Student student = context.getBean("student", Student.class);
        System.out.println(student);
    }
    @Test
    public void studentP(){
        ApplicationContext context=new ClassPathXmlApplicationContext
                ("bean-diref.xml");
        Student student=context.getBean("studentp",Student.class);
        System.out.println(student);
    }
}
